package com.slj.service.impl;

import com.slj.model.entity.Suppliers;
import com.slj.mapper.SuppliersMapper;
import com.slj.service.SuppliersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 供应商表 服务实现类
 * </p>
 *
 * @author 礼俊
 * @since 2025-09-20 22:46
 */
@Service
@Slf4j
public class SuppliersServiceImpl extends ServiceImpl<SuppliersMapper, Suppliers> implements SuppliersService {

    /**
     * 编辑员工
     * @param suppliers
     * @return
     */
    @Override
    public Integer editSupplier(Suppliers suppliers) {
        if (suppliers.getSupplierId()!= null) {
            log.info("编辑员工");
            return baseMapper.updateById(suppliers);

        }else {
            log.info("添加员工");
            return baseMapper.insert(suppliers);
        }
    }
}
